package com.ruoyi.web.controller.tzzl;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.tzzl.domain.WzBalanceChangeRecord;
import com.ruoyi.tzzl.domain.WzOrder;
import com.ruoyi.tzzl.domain.vo.QueryVo;
import com.ruoyi.tzzl.service.IWzBalanceChangeRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 余额变更记录Controller
 * @author by caoyong
 * @date 2022/11/22
 **/
@RestController
@RequestMapping("/tzzl/balance")
public class WzBalanceChangeRecordController  extends BaseController {

    @Autowired
    private IWzBalanceChangeRecordService wzBalanceChangeRecordService;



    /**
     * 余额记录列表
     * */
    @GetMapping("/list")
    public TableDataInfo balanceRecord(QueryVo queryVo){
        startPage();
        List<WzBalanceChangeRecord> list = wzBalanceChangeRecordService.balanceRecord(queryVo);
        return getDataTable(list);
    }


    /**
     * 红娘分销排行榜
     * */
    @GetMapping("/distributionRanking")
    public TableDataInfo distributionRanking(){
        startPage();
      List<WzBalanceChangeRecord> list =  wzBalanceChangeRecordService.distributionRanking();
        return getDataTable(list);
    }

    /**
     * 查看用户业绩
     * */
    @GetMapping("/userPerformance")
    public AjaxResult userPerformance(Long id){
        return AjaxResult.success(wzBalanceChangeRecordService.userPerformance(id));
    }


}
